﻿Imports GT = Gadgeteer
Imports GTM = Gadgeteer.Modules
Imports Gadgeteer.Modules.GHIElectronics




Namespace GadgeteerApp1
    Partial Public Class Program

        ' This is run when the mainboard is powered up or reset. 
        Public Sub ProgramStarted()
            ' The notes are as follows
            ' Happy birthday to you
            ' CC D C G F
            ' Happy birthday to you
            ' CC D C G F
            ' Happy birthday dear Brian
            ' CC C (High C) A F E D
            ' Happy birthday to you
            ' Bb Bb A F G F
            ' The frequency of Bb is 466


            ' Use Debug.Print to show messages in Visual Studio's "Output" window during debugging.
            Debug.Print("Program Started")
            Dim melody As Tunes.Melody = New Tunes.Melody()
            ' CC D C F E
            melody.Add(261, 300)
            melody.Add(261, 300)
            melody.Add(293, 600)
            melody.Add(261, 600)
            melody.Add(349, 600)
            melody.Add(329, 1200)
            ' CC D C G F
            melody.Add(261, 300)
            melody.Add(261, 300)
            melody.Add(293, 600)
            melody.Add(261, 600)
            melody.Add(392, 600)
            melody.Add(349, 1200)
            ' CC C (High C) A F E D
            melody.Add(261, 300)
            melody.Add(261, 300)
            melody.Add(523, 600)
            melody.Add(440, 600)
            melody.Add(349, 600)
            melody.Add(329, 600)
            melody.Add(293, 1200)
            ' Bb Bb A F G F
            melody.Add(466, 300)
            melody.Add(466, 300)
            melody.Add(440, 600)
            melody.Add(349, 600)
            melody.Add(392, 600)
            melody.Add(349, 1800)


            ''Now play the melody
            tunes.Play(melody)

            Thread.Sleep(1000)



        End Sub

        ' If you want to do something periodically, declare a GT.Timer by uncommenting the below line
        '   and then use the dropdown boxes at the top of this window to generate a Tick event handler.
        ' Dim WithEvents timer As GT.Timer = new GT.Timer(1000)  ' every second (1000ms)

    End Class
End Namespace